import request from '@/utils/request';
import { ListParams } from './data';
import { formatCurrentStateData } from '@/helpers/RequestHelper';

export async function queryRule(params?: ListParams) {
  return request('/api/admin/admin/findAdminConfig', {
    params,
  })?.then(
    (response):any => formatCurrentStateData(response)
  ).catch((error) => {})
}

export async function updateRule(params: ListParams) {
  return request('/api/admin/admin/updateAdminConfig', {
    method: 'POST',
    data: {
      ...params,
      method: 'update',
    },
  })?.then((response) => {
    return response;
  });
}
